﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace TinyCinema
{
    /// <summary>
    /// Interaction logic for SampleDataInstaller.xaml
    /// </summary>
    public partial class SampleDataInstaller : Window
    {
        public SampleDataInstaller()
        {
            InitializeComponent();
            var dataContext = DataContext as Bussiness.Login.ServerLogin;
            dataContext.Messenger.Register<Bussiness.Login.Message.InstallSampleDataSuccessful>(this, (s) =>
            {
                MessageBoxUtils.WPFMessageBox.Show("Cài đặt dữ liệu mẫu thành công", "", MessageBoxButton.OK);
                this.Close();
            });
            dataContext.Messenger.Register<Bussiness.Login.Message.ContinueWithoutInstallSampleData>(this, (s) =>
            {
                this.Close();
            });
        }

        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }

        private void Cancel(object sender, RoutedEventArgs e)
        {
            App.Current.Shutdown();
        }
    }
}
